<?php

namespace App\Models;

use Encore\Admin\Traits\DefaultDatetimeFormat;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class Order extends Model
{
    use HasFactory,DefaultDatetimeFormat;


    const ORDER_STATE_AUDITING = 0;//审核中
    const ORDER_STATE_AUDIT_REFUSE = 2;//审核拒绝
    const ORDER_STATE_ON = 4;//开启
    const ORDER_STATE_OFF = 5;//关闭
    const ORDER_STATE_COMPLETE = 6;//完成
    const ORDER_STATE_AUDIT_WAITING = 7;//待投放

    const ORDER_TYPE_COMMON = 0;//普通快单
    const ORDER_TYPE_CURVE = 1;//曲线快单

    public function tire(){
        return $this->belongsTo(Tire::class);
    }

    public function adminUser(){
        return $this->belongsTo(AdminUser::class);
    }

    public function orderReadInfo(){
        return $this->hasMany(OrderReadInfo::class);
    }

    public function curveOrderRecord(){
        return $this->hasMany(CurveOrderRecord::class);
    }
}
